from django.http import HttpResponse
from lyricsplit.models import EmoAnno,EmoAnnoOk
import logging
import simplejson

def update_unanno1(request):
    m_list = []
    for ea in EmoAnno.all().filter('emo =','unknown'):
        for eao in EmoAnnoOk.all().filter('lrc =',ea.lrc):
            eao.anno_ok = 0
            eao.put()
            m_list.append(str(eao.lrc.key()))
    m_list.append(len(m_list))
    return HttpResponse(simplejson.dumps(m_list))
